How to: Cancel a report that does not contain any records.
Solution:
In the Reports Design view, use the 'On No Data' property box in the property sheet to assign a 'Cancel Event' macro to the report.
1) If the Database window is not active, activate the Database window.
2) Click the 'Reports' tab.
Reports tab
3) Select the desired report. (The selected report is highlighted.)
4) Click 'Design'.
5) Select the 'View' menu and select 'Properties'. (The property sheet appears.)
6) Click the 'Event' tab.
7) Click on the 'On No Data' box. (A build button appears.)
8) Click 'Build'. (The Choose Builder dialog box appears.)
9) Select 'Macro Builder' from the 'Choose Builder' list box.
10) Click 'OK'. (The Save As dialog box appears.)
11) Type the desired name for the macro in the 'Macro Name' box.
12) Click 'OK'. (The Macro grid appears.)
13) Click on the down arrow of the 'Action' box.
14) Select 'Cancel Event' from the 'Action' drop-down list.
15) Select the 'File' menu and select 'Save' to save changes to the macro.
16) Click on the 'X' in the upper right corner of the 'Macro' window to close the macro.
17) Select the 'File' menu and select 'Save' to save changes to the report.